home *** CD-ROM | disk | FTP | other *** search
Wrap
;----------------------------------------------------------------------------- ; TITLE : Install ; VERSION : 1.0 ; DATE : 24.02.2002 ; DESCRIPTION : Installer script for DelfTweak ; INPUT : - ; OUTPUT : - ;----------------------------------------------------------------------------- ; MODIFICATIONS: - ;----------------------------------------------------------------------------- ; LIMITATIONS AND BUGS ; - ;----------------------------------------------------------------------------- ; $VER: Install 1.0 (23.02.2002) ;----------------------------------------------------------------------------- ; VARIABLES VARIABLES VARIABLES VARIABLES VARIABLES VARIABLES VARIABLES VARIA ;----------------------------------------------------------------------------- (set #config_ok 1) ; Default: configuration is ok (set #cpu "???(20|30|40|60)") ; Required CPU (set #installer_ver 43) ; Minimum Installer version (set #installer_rev 3) ; Minimum Installer revision (set #os_ver 40) ; Minimum OS version (set #os_rev 10) ; Minimum OS revision (set #appsize 1000000) ; Required diskspace for application ; (bytes) (set #configcheckmask %001) ; Configuration check mask: ; bit0 (right) = cpu ; bit1 (middle) = os version ; bit2 (left) = disk space (set #application "DelfTweak") ; Application ; Default language (English) (set #string1 ("\nInstaller version %ld.%ld required.\nPlease check your configuration." #installer_ver #installer_rev)) (set #string2 ("\n%s\n\nCopyright © 2002 Janne Peräaho.\nAll Rights Reserved." #application)) (set #string3 ("\n%s has now been installed.\nYou may now reboot your Amiga." #application)) (set #string4 "\nAt least 68020 CPU, Installer version 43.3 and delfina.library required.\nPlease check your configuration.") (set #string5 "\nSelect components to be installed.") (set #string50 "\nSOFTWARE COMPONENTS\n\nDelfTweak package consists of binary executable (DelfTweak), Amiga guide documentation (DelfTweak.guide), and AmigaDOS scripts.\n\nIn this section you may select the prefered software components to be installed.") (set #string51 "DelfTweak (about 17 kB)") (set #string52 "Documentation (about 27 kB)") (set #string53 "Overclocking script (about 100 B )") (set #string6 "\nSelect new clock frequency for Delfina Lite.") (set #string60 "\nCLOCK FREQUENCY\n\nHere you may select a startup script which will set a new clock frequency for your Delfina Lite.\n\nIf you do not have a standard 40 MHz Delfina Lite, DO NOT INSTALL ANY OF THESE SCRIPTS! They may cause permanent damage to nonstandard Delfina Lite or other Delfina models.") (set #string61 "40 MHz (default clock speed)") (set #string62 "44 MHz (10% overclocking)") (set #string63 "48 MHz (20% overclocking)") (set #string64 "52 MHz (30% overclocking)") (set #string65 "56 MHz (40% overclocking)") (set #string66 "60 MHz (50% overclocking)") (set #string67 "64 MHz (60% overclocking)") (set #string601 "(40MHz|40MHz.info)") ; Script file names (set #string602 "(44MHz|44MHz.info)") (set #string603 "(48MHz|48MHz.info)") (set #string604 "(52MHz|52MHz.info)") (set #string605 "(56MHz|56MHz.info)") (set #string606 "(60MHz|60MHz.info)") (set #string607 "(64MHz|64MHz.info)") (set #string7 "\nSelect target directory for DelfTweak.") (set #string70 "\nINSTALLING DELFTWEAK\n\nDelfTweak will be copied to the selected directory.") (set #string71 "C:") (set #string72 "\nSelect target directory for DelfTweak documentation (HELP: directory recommended).") (set #string73 "\nINSTALLING DELFTWEAK DOCUMENTATION\n\nDelfTweak.guide will be copied to the selected directory.") (set #string74 "HELP:") (set #string75 "\nSelect target directory for overclocking script (SYS:WBStartup directory recommended).") (set #string76 "\nINSTALLING OVERCLOCKING SCRIPT\n\nOverclocking script will be copied to the selected directory.") (set #string77 "SYS:WBStartup/") (set #string8 "\nInstalling DelfTweak...") (set #string80 "\nINSTALLING DELFTWEAK\n\nDelfTweak will be copied into the target directory.") (set #string81 "Executables/") (set #string82 "#?") (set #string83 "\nInstalling DelfTweak documentation...") (set #string84 "\nINSTALLING DOCUMENTATION\n\nDelfTweak.guide will be copied into the target directory.") (set #string85 "Docs/") (set #string86 "DelfTweak(.guide|.guide.info)") (set #string87 "Installing overclocking script...") (set #string88 "\nINSTALLING OVERCLOCKING SCRIPT\n\nOverclocking script will be copied into the target directory.") (set #string89 "Settings/Delfina Lite 40 MHz/") (set #string8a #string601) ; Name of the overclocking script file to be installed ;----------------------------------------------------------------------------- ; SUBROUTINES SUBROUTINES SUBROUTINES SUBROUTINES SUBROUTINES SUBROUTINES SUB ;----------------------------------------------------------------------------- ;----------------------------------------------------------------------------- ; TITLE : p_DecodeVersion ; VERSION : 0.10 ; DATE : 30.08.1998 ; DESCRIPTION : Get version and revision from raw version number ; INPUT : #version - raw version number ; OUTPUT : #ver - version number ; #rev - revision number ;----------------------------------------------------------------------------- ; MODIFICATIONS: - ;----------------------------------------------------------------------------- (procedure p_DecodeVersion #version (set #ver (/ #version 65536)) (set #rev (- #version (* #ver 65536))) ) ;----------------------------------------------------------------------------- ; TITLE : p_EncodeVersion ; VERSION : 0.10 ; DATE : 30.08.1998 ; DESCRIPTION : Create raw version number from version and revision number ; INPUT : #ver - version number ; #rev - revision number ; OUTPUT : #version - raw version number ;----------------------------------------------------------------------------- ; MODIFICATIONS: - ;----------------------------------------------------------------------------- (procedure p_EncodeVersion #ver #rev (set #version (+ (* #ver 65536) #rev)) ) ;----------------------------------------------------------------------------- ; TITLE : p_CheckConfiguration ; VERSION : 0.10 ; DATE : 30.08.1998 ; DESCRIPTION : Check if requirements match with current configuration ; INPUT : - ; OUTPUT : #config_ok - 0=not ok, 1=ok ;----------------------------------------------------------------------------- ; MODIFICATIONS: - ;----------------------------------------------------------------------------- (procedure p_CheckConfiguration ; Variables (set #config_ok 1) ; Check CPU (if (in #configcheckmask 0) ( (if (not (patmatch #cpu (database "cpu"))) ( (set #config_ok 0) ) ); if ) ); if ; Check OS version (if (in #configcheckmask 1) ( (p_EncodeVersion #os_ver #os_rev) (if (< #version (getversion)) (set #config_ok 0) ); if ) ); if ; Check diskspace (if (in #configcheckmask 2) ( (set #availdspace (getdiskspace @default-dest)) ; Information not available (if (not (< #availdspace 0)) ; Not enough room (if (< #availdspace #appsize) (set #config_ok 0) ); if ); if ) ); if ); p_CheckConfiguration ;----------------------------------------------------------------------------- ; TITLE : p_GetDestination ; VERSION : 0.10 ; DATE : 30.08.1998 ; DESCRIPTION : Get destination directory ; INPUT : - ; OUTPUT : @default-dest ;----------------------------------------------------------------------------- ; MODIFICATIONS: - ;----------------------------------------------------------------------------- (procedure p_GetDestination #d1string #d2string #d3string (set @default-dest (askdir (prompt #d1string) (help #d2string) (default #d3string) (disk) ); askdir ) ); p_GetDestination ;----------------------------------------------------------------------------- ; TITLE : p_CopyFiles ; VERSION : 0.10 ; DATE : 30.08.1998 ; DESCRIPTION : Copy files ; INPUT : - ; OUTPUT : - ;----------------------------------------------------------------------------- ; MODIFICATIONS: - ;----------------------------------------------------------------------------- (procedure p_CopyFiles #c1string #c2string #c3string #c4string (copyfiles (prompt #c1string) (help #c2string) (source #c3string) (dest @default-dest) (pattern #c4string) (optional "force") ); copyfiles ); p_CopyFiles ;----------------------------------------------------------------------------- ; MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN ;----------------------------------------------------------------------------- ; Welcome message (welcome #string2) ; Check Installer version (p_EncodeVersion #installer_ver #installer_rev) (if (< @installer-version #version) ( (exit #string1 (quiet)) ) ); if ; Ask options (software packages to install) (set #installoptions (askoptions (prompt #string5) (help #string50) (choices #string51 #string52 #string53) (default %111) ); askoptions ) ; Last option - Overclocking script (ask clock speed) (if (in #installoptions 2) ; Ask overclocking frequency ( (set #frequencychoice (askchoice (prompt #string6) (help #string60) (choices #string61 #string62 #string63 #string64 #string65 #string66 #string67) (default 0) ); askoptions ) ; Get and set script name (set #string8a (select #frequencychoice (#string601) (#string602) (#string603) (#string604) (#string605) (#string606) (#string607) ); select ) ) ); if ; First option - DelfTweak (if (in #installoptions 0) ( ; Get destination directory (p_GetDestination #string7 #string70 #string71) ; Check configuration (p_CheckConfiguration) (if (< #config_ok 1) (exit #string4 (quiet)) ); if ; Copy files (p_CopyFiles #string8 #string80 #string81 #string82) ) ); if ; Second option - Documentation (if (in #installoptions 1) ( ; Get destination directory (p_GetDestination #string72 #string73 #string74) ; Check configuration (p_CheckConfiguration) (if (< #config_ok 1) (exit #string4 (quiet)) ); if ; Copy files (p_CopyFiles #string83 #string84 #string85 #string86) ) ); if ; Last option - Overclocking (if (in #installoptions 2) ( ; Get destination directory (p_GetDestination #string75 #string76 #string77) ; Check configuration (p_CheckConfiguration) (if (< #config_ok 1) (exit #string4 (quiet)) ); if ; Copy files (p_CopyFiles #string87 #string88 #string89 #string8a) ) ); if ; All done (exit #string3 (quiet))